home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Arsenal Files 2
/
The Arsenal Files 2 (Arsenal Computer).ISO
/
lan
/
nwcwin.exe
/
VNRN.MST
< prev
next >
Wrap
Text File
|
1994-05-26
|
7KB
|
260 lines
'**************************************************************************
'* MSSetup Toolkit Sample 1
'**************************************************************************
'$DEFINE DEBUG ''Define for script development/debugging
'$INCLUDE 'setupapi.inc'
'$INCLUDE 'msdetect.inc'
DECLARE FUNCTION IsDeviceVNRNListed LIB "mscuistf.dll" () As INTEGER
''Dialog ID's
CONST WELCOME = 100
CONST ASKQUIT = 200
CONST DESTPATH = 300
CONST EXITFAILURE = 400
CONST EXITQUIT = 600
CONST EXITSUCCESS = 700
CONST OPTIONS = 800
CONST APPHELP = 900
CONST BADPATH = 6400
CONST NETPATH = 1000
CONST CLIENTPATH = 1100
''Bitmap ID
CONST LOGO = 1
GLOBAL CLIENTDEST$ ''Default destination directory.
GLOBAL NETDEST$ ''Default destination directory.
GLOBAL DEST$ ''Default destination directory.
GLOBAL OPTCUR$ ''Option selection from option dialog.
DECLARE SUB Install
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
INIT:
CUIDLL$ = "mscuistf.dll" ''Custom user interface dll
HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
SetBitmap CUIDLL$, LOGO
SetTitle "NetWare Connect VNRN Setup"
szInf$ = GetSymbolValue("STF_SRCINFPATH")
IF szInf$ = "" THEN
szInf$ = GetSymbolValue("STF_CWDDIR") + "vnrn.INF"
END IF
ReadInfFile szInf$
OPTCUR$ = "1"
DEST$ = GetWindowsSysDir()
WELCOME:
UIPop 1
GETNETPATH:
SetSymbolValue "EditTextIn", NETDEST$
SetSymbolValue "EditFocus", "END"
GETNETPATHL1:
sz$ = UIStartDlg(CUIDLL$, NETPATH, "FEditNetDlgProc", APPHELP, HELPPROC$)
NETDEST$ = GetSymbolValue("EditTextOut")
IF sz$ = "CONTINUE" THEN
IF IsDirWritable(NETDEST$) = 0 THEN
GOSUB BADPATH
GOTO GETNETPATHL1
END IF
UIPop 1
ELSEIF sz$ = "REACTIVATE" THEN
GOTO GETNETPATHL1
ELSEIF sz$ = "BACK" THEN
GOTO GETNETPATHL1
ELSE
GOSUB ASKQUIT
GOTO GETNETPATH
END IF
GETCLIENTPATH:
SetSymbolValue "EditTextIn", NETDEST$
SetSymbolValue "EditFocus", "END"
GETCLIENTPATHL1:
sz$ = UIStartDlg(CUIDLL$, CLIENTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
CLIENTDEST$ = GetSymbolValue("EditTextOut")
IF sz$ = "CONTINUE" THEN
IF IsDirWritable(CLIENTDEST$) = 0 THEN
GOSUB BADPATH
GOTO GETCLIENTPATHL1
END IF
UIPop 1
ELSEIF sz$ = "REACTIVATE" THEN
GOTO GETCLIENTPATHL1
ELSEIF sz$ = "BACK" THEN
UIPop 1
GOTO GETNETPATH
ELSE
GOSUB ASKQUIT
GOTO GETCLIENTPATH
END IF
Install
QUIT:
ON ERROR GOTO ERRQUIT
IF ERR = 0 THEN
dlg% = EXITSUCCESS
ELSEIF ERR = STFQUIT THEN
dlg% = EXITQUIT
ELSE
dlg% = EXITFAILURE
END IF
QUITL1:
sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO QUITL1
END IF
UIPop 1
END
ERRQUIT:
i% = DoMsgBox("Setup sources were corrupted!", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
END
BADPATH:
sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO BADPATH
END IF
UIPop 1
RETURN
ASKQUIT:
sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
IF sz$ = "EXIT" THEN
UIPopAll
ERROR STFQUIT
ELSEIF sz$ = "REACTIVATE" THEN
GOTO ASKQUIT
ELSE
UIPop 1
END IF
RETURN
'**
'** Purpose:
'** Builds the copy list and performs all installation operations.
'** Arguments:
'** none.
'** Returns:
'** none.
'*************************************************************************
SUB Install STATIC
SrcDir$ = GetSymbolValue("STF_SRCDIR")
CreateDir DEST$, cmoNone
CreateDir CLIENTDEST$, cmoNone
OpenLogFile MakePath(DEST$, "LOGFILE.OUT"), 0
WriteToLogFile ""
WriteToLogFile " User chose as destination directory: '" + DEST$ + "'"
WriteToLogFile " User chose option: '" + OPTCUR$ + "'"
WriteToLogFile ""
WriteToLogFile "May have had to create the directory: " + DEST$
WriteToLogFile ""
' Copy Windows Files to windows system directory
AddSectionFilesToCopyList "WinFiles", SrcDir$, DEST$
CopyFilesInCopyList
inipath$ = GetWindowsDir()
ini$ = MakePath(inipath$, "SYSTEM.INI")
IF IsDeviceVNRNListed() = 1 THEN
AddVNRN% = 0
ELSE
AddVNRN% = 1
ENDIF
network$ = GetIniKeyString(ini$,"386enh","network")
loopindex% = 1
AddVIPX% = 1
VIPX_LOOP:
loopvar$ = GetNthFieldFromIniString(network$,loopindex%)
IF loopvar$ = "" THEN
GOTO VIPX_EXIT
ELSEIF loopvar$ = "vipx.386" THEN
AddVIPX% = 0
GOTO VIPX_EXIT
ELSEIF loopvar$ = "vipx" THEN
AddVIPX% = 0
GOTO VIPX_EXIT
ENDIF
loopindex% = loopindex% + 1
GOTO VIPX_LOOP
VIPX_EXIT:
IF AddVIPX% = 1 OR AddVNRN% = 1 THEN
' If a change needs to be made to the SYSTEM.INI, then backup file
CopyFile ini$,inipath$+"SYSTEM.BAK",cmoOverwrite,0
'If VNRN Needs to be added, then add it
IF AddVNRN% = 1 THEN
CreateSysIniKeyValue ini$, "386enh", "device", "vnrn.386", cmoVital
ENDIF
'If VIPX Needs to be added, then add it
IF AddVIPX% = 1 THEN
IF network$ = "" THEN
CreateIniKeyValue ini$, "386enh", "network", "vipx.386", cmoAll
ELSE
CreateIniKeyValue ini$, "386enh", "network", network$+",vipx.386", cmoAll
ENDIF
ENDIF
ENDIF
' Copy Client Software to target directory
AddSectionFilesToCopyList "NWFiles", SrcDir$, CLIENTDEST$
CopyFilesInCopyList
CloseLogFile
END SUB
'**
'** Purpose:
'** Appends a file name to the end of a directory path,
'** inserting a backslash character as needed.
'** Arguments:
'** szDir$ - full directory path (with optional ending "\")
'** szFile$ - filename to append to directory
'** Returns:
'** Resulting fully qualified path name.
'*************************************************************************
FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
IF szDir$ = "" THEN
MakePath = szFile$
ELSEIF szFile$ = "" THEN
MakePath = szDir$
ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
MakePath = szDir$ + szFile$
ELSE
MakePath = szDir$ + "\" + szFile$
END IF
END FUNCTION